package com.psp.bu.service;

import java.util.List;

import com.psp.bu.controller.res.bean.RProductListBean;
import com.psp.bu.controller.res.bean.RProductSkuBean;
import com.psp.bu.controller.res.bean.RServicesTypeBean;
import com.psp.bu.controller.res.bean.RAttributeBean;
import com.psp.bu.controller.res.bean.RProductDetailBean;
import com.psp.bu.controller.res.bean.RProductEditDetailBean;
import com.psp.bu.service.exception.ServiceException;
import com.psp.bu.service.impl.PageResult;

public interface ProductService {

	/**
	 * 保存商品
	 * 
	 * @param userId
	 * @param category
	 * @param type
	 * @param title
	 * @param subTitle
	 * @param img
	 * @param quoteType
	 * @param price
	 * @param serviceContent
	 * @param serviceSafe
	 * @param linkMan
	 * @param telephone
	 * @param attributeJson
	 * @param attributeArr
	 * @param attributeValueArr
	 * @param hasInvocie
	 * @return
	 */
	boolean save(String userId, int category, int type, String title, String subTitle, String img, int quoteType,
			double price, String serviceContent, String serviceSafe, String linkMan, String telephone,
			String attributeJson, String attributeArr, String attributeValueArr, int hasInvocie)
			throws ServiceException;

	/**
	 * 商品更新
	 * 
	 * @param userId
	 * @param category
	 * @param type
	 * @param title
	 * @param subTitle
	 * @param img
	 * @param quoteType
	 * @param price
	 * @param serviceContent
	 * @param serviceSafe
	 * @param linkMan
	 * @param telephone
	 * @param attributeJson
	 * @param attributeAtrr
	 * @param attributeValueArr
	 * @param hasInvocie
	 * @param bid
	 * @return
	 */
	boolean update(String userId, int category, int type, String title, String subTitle, String img, int quoteType,
			double price, String serviceContent, String serviceSafe, String linkMan, String telephone,
			String attributeJson, String attributeAtrr, String attributeValueArr, int hasInvocie, String bid)
			throws ServiceException;

	/**
	 * 商品列表：
	 * 
	 * @param page
	 * @param pageSize
	 * @param uid
	 * @param shelfState
	 *            1在架，2不在架
	 * @return
	 */
	PageResult<RProductListBean> getList(int page, int pageSize, String buid, int shelfState);

	/**
	 * 批量上架
	 * 
	 * @param list
	 * @return
	 */
	boolean onShelfBatch(String uid, List<String> list) throws ServiceException;

	/**
	 * 批量下架
	 * 
	 * @param list
	 * @return
	 */
	boolean offShelfBatch(String uid, List<String> list) throws ServiceException;

	/**
	 * 业务员批量删除自己发布的商品--软删除
	 * 
	 * @param list
	 * @return
	 */
	boolean deleteBatch(String uid, List<String> list) throws ServiceException;

	/**
	 * 获取商品详情
	 * 
	 * @param userId
	 * @param bid
	 * @return
	 */
	RProductDetailBean getProductDetail(String userId, String bid) throws ServiceException;

	/**
	 * 获取商品编辑是的详情
	 * 
	 * @param buid
	 * @param pid
	 * @return
	 */
	RProductEditDetailBean getProductDetailDetail(String buid, String pid) throws ServiceException;

	RServicesTypeBean getSubServiceTypes(int pcode);

	List<RAttributeBean> getAttributes(String pid);

	RProductSkuBean getProductInfoBySkuno(String skuCode);

}
